﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Web;
using System.Web.Services;

namespace SBPweb.Services.Base
{
    public abstract class ServiceBase : WebService
    {

        #region Private fields

//        private List<ParsingClientBase> pClientCache = new List<ParsingClientBase>();

        #endregion

        #region Methods

//        protected abstract ParsingClientBase CreateClientInstance();

        //public abstract Dictionary<string, MethodInfo> EnumerateAvailableMethods();

        #region Private helper functions
/*
        protected ParsingClientBase GetAvailableClient()
        {
            lock (pClientCache)
            {
                foreach (ParsingClientBase pC in pClientCache)
                {
                    if (!pC.IsBusy)
                    {
                        return pC;
                    }
                }
                ParsingClientBase ret = CreateClientInstance();
                ret.IsIdle += new EventHandler(ret_IsIdle);
                pClientCache.Add(ret);
                return ret;
            }
        }

        private void ret_IsIdle(object sender, EventArgs e)
        {
            lock (pClientCache)
            {
                ParsingClientBase pC = sender as ParsingClientBase;
                pClientCache.Remove(pC);
                pClientCache.Insert(0, pC);
            }
        }
*/
        #endregion

        #endregion

    }
}
